import { createStore } from 'redux'
import { persistStore, persistReducer } from 'redux-persist'
import storage from 'redux-persist/lib/storage'

//导入纯函数
import {reducer} from './reducer'

//对reducer进行持久化处理
var  persistedReducer = persistReducer( {key:'redux',storage}, reducer );

//实例化store
export var store = createStore(persistedReducer)

//对store进行持久化
export var persistor = persistStore(store);
